/*
 * io.cpp
 *
 *  Created on: 2016-2-27
 *      Author: ZhangXiyin
 */

#include "io.h"

#include "single/service.h"
#include "process/processor.h"
#include "gc/gc.h"

namespace eyas{
namespace io{
class io_instance : public eyas::basic::singleton<io_instance>{
public:
	io_instance(){
	}
	virtual ~io_instance(){
		eyas::io::service::instance()->io_service().stop();
	}
};
void init(){
	eyas::gc::init();
	eyas::process::init();
	service::instance();
	io_instance::instance();
}
void clean(){

}

tcp_client_ptr create_tcp_client(){
	return eyas::gc::create_new<tcp_client>();
}
tcp_server_ptr create_tcp_server(){
	return eyas::gc::create_new<tcp_server>();
}

}
}

